<template>
  <div class="all">
    <div class="top">
      <header>
        <div class="div" @click="back">
          <img src="../../../assets/返回.png" alt="">
          <span class="solid">返回</span>
        </div>
        <div class="div">
          <span>{{title}}</span>
        </div>
        <div class="div">
          <span></span>
        </div>
      </header>
      <div class="searchDiv">
        <div class="search">
          <van-icon name="search" class="search_img" />
          <input type="text"
                 v-model="searchVal"
                 placeholder="项目名称">
          <van-icon name="close"
                    v-show="searchVal"
                    class="close_img" @click="searchVal = ''" />
        </div>
      </div>
    </div>
    <router-view/>
  </div>
</template>

<script>
import Header from '../../../components/Vue/Header'
export default {
  name: 'JuJiaTeamXiangmu',
  components: {
    Header
  },
  data () {
    return {
      userid: this.$route.query.userid,
      title: this.$route.query.title,
      team_id: this.$route.query.team_id,
      searchVal: ''
    }
  },
  watch: {
    searchVal (val1, val2) {
      if (val1 !== val2) {
        this.$router.replace({path: '/JuJiaTeamXiangmu',
          query: {
            userid: this.userid,
            team_id: this.team_id,
            title: this.title,
            searchVal: this.searchVal
          }
        })
      }
    }
  },
  methods: {
    // 返回
    back () {
      this.$router.history.go(-1)
    }
  }
}
</script>

<style scoped lang="scss">
.all{
  width: 100%;
  height: 100%;
  background: #FAF9FE;
  overflow: auto;
  font-size: 15px;
  font-family: PingFang SC;
}
.top{
  position: sticky;
  top: 0;
  z-index: 9;
}
header{
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #E5E5E5;
  background: white;
}
.div{
  width: 33%;
  height: 100%;
  display: flex;
  align-items: center;
  font-family: "PingFang SC";
  font-size: 15px;
  font-weight: bold;
}
.div img{
  margin-right: 5px;
}
.div:nth-child(1) img{
  height: 13px;
  width: 7px;
  margin-left: 15px;
}
.div:nth-child(3) img{
  margin-right: 5px;
  width: 13px;
  height: 13px;
}
.div:nth-child(3) span{
  margin-right: 15px;
}
.div:nth-child(2){
  justify-content: center;
}
.div:nth-child(3){
  justify-content: flex-end;
}
.solid{
  color: #1DA4F2;
}
.searchDiv{
  width: 100%;
  height: 44px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #E5E5E5;
}
.search{
  width: 90%;
  //margin-left: 10px;
  height: 29px;
  background: #FAF9FE;
  border-radius: 15px;
  display: flex;
  align-items: center;
  overflow: hidden;
.search_img{
  font-size: 17px;
  padding: 0 8px;
  box-sizing: border-box;
}
input{
  flex: 1;
  overflow: auto;
  border: none;
  background: transparent;
}
.close_img{
  font-size: 13px;
  padding: 0 8px;
  box-sizing: border-box;
}
}
</style>
